<div id="dialog-form-report" title="<?php echo $current_tab["display_name"];?>"></div>
<div style="margin: 20px">
<div>
	<label for="from" style="width: 0px;"></label>
	从
	<input type="text" id="from" name="from" style="display:inline;float: none;" value="<?php if (!empty($search_result_startdate)) echo $search_result_startdate?>"/>
	<label for="to" style="width: 0px;"></label>
	至
	<input type="text" id="to" name="to" style="display:inline;float: none;" value="<?php if (!empty($search_result_enddate)) echo $search_result_enddate?>"/>
	<button id="query-report">查询</button>
</div>
</div>
<div id="category-contain" class="ui-widget">
<table id="category" class="ui-widget ui-widget-content">
	<thead>
		<tr class="ui-widget-header ">
			<th>排名</th>
			<th>商家名称</th>
			<th>浏览量</th>
		</tr>
	</thead>
	<tbody>
	<?php
	$count = 1;
	foreach ($scan_result as $item){
		echo '<tr>';
		echo '<td>'.$count.'</td>';
		echo '<td>'.$item["desc"].'</td>';
		echo '<td>'.$item["county"].'</td>';
		echo '</tr>';
		$count++;
	}?>
	</tbody>
</table>
</div>

<div id="report-contain" class="ui-widget">
<table id="report" class="ui-widget ui-widget-content">
	<thead>
		<tr class="ui-widget-header ">
			<th>排名</th>
			<th>关键字</th>
			<th>搜索次数</th>
		</tr>
	</thead>
	<tbody>
	<?php
	$count = 1;
	foreach ($search_result as $item){
		echo '<tr>';
		echo '<td>'.$count.'</td>';
		echo '<td>'.$item["desc"].'</td>';
		echo '<td>'.$item["county"].'</td>';
		echo '</tr>';
		$count++;
	}?>
	</tbody>
</table>
</div>
<script type="text/javascript" src="<?php echo URL::base()?>jquery/development-bundle/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="<?php echo URL::base()?>jquery/development-bundle/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="<?php echo URL::base()?>jquery/development-bundle/ui/jquery.ui.datepicker.js"></script>
<script>
	$(function() {
		var dates = $( "#from, #to" ).datepicker({
			defaultDate: "2012-11-20",
			changeMonth: true,
			numberOfMonths: 3,
			dateFormat:'yy-mm-dd',
			onSelect: function( selectedDate ) {
				var option = this.id == "from" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" ),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates.not( this ).datepicker( "option", option, date );
			}
		});

		$("#query-report").button().click(function() {
			var startDate = $("#from").val();
			var endDate = $("#to").val();
			var params = {
					startdate:startDate,
					enddate:endDate
				}
				mask.open(true);
				ajaxGet(website + "boReport/search",params,function(result){
					var tabOrder = $("#currentTabOrder").val();
					$("#tabs-"+tabOrder).html(result);
					mask.close();
				},"html");
		});
	});
</script>